
public class DateValidator {

	public boolean checkDay(int day){
		
		if(day > 0  && day < 31){
			
			return true;
		}
		
		return false;
		
	}
	
	
	public boolean checkMonth(int month){
		
		if(month > 0 && month < 13){
			
			return true;
		}
		
		return false;
	}
	
	
	public boolean checkYear(int year){
		
		if(year > 1900 && year < 2014){
			
			return true;
		}
		
		return false;
	}
	
	
	public boolean checkDate(int day, int month, int year){
		
	boolean validDate = checkDay(day) && checkMonth(year) && checkYear(year);
	
	if(day > 30 && (month == 4 || month ==  6 || month ==  9 || month ==  11)){
		
		
		validDate = false;
	}
	
	else if(day > 28 && month == 2){
		
		validDate = false;
		
	}
	

	else{
		
		validDate = true;
	}
	
	
	return validDate;
	
	
	
	
	
		
	}
}
